; (function () {
    $(function () {
        var btn_top = document.createElement('div')
        $(btn_top).css({
            cursor: 'pointer',
            width: 52,
            height: 52,
            background: 'url(./img/common/下载.png) no-repeat',
            backgroundSize: '100%',
            position: 'fixed',
            bottom: 80,
            right: 80,
            zIndex: 9999999,
            display: 'none'
        })

        $('body').append(btn_top)
        $(document).bind('scroll', function (event) {
            var top = $(window).scrollTop()
            if (top == 0) {
                $(btn_top).hide()
            }
            if (top > 10) {
                $(btn_top).show()
            }
        })

        $(btn_top).on('mouseover mouseout', function (even) {
            var s = even.type
            if (s == 'mouseover') {
                $(btn_top).css('background', 'url(./img/common/下载2.png) no-repeat')
            } else {
                $(btn_top).css('background', 'url(./img/common/下载.png) no-repeat')
            }
        })

        $(btn_top).on('click',function(){
            $("html").animate({
              scrollTop:0
            },700)
        })

    })
})()